<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Layui</title>
    <link rel="stylesheet" th:href="@{/pear/component/luminar/css/luminar.css}">

    <style>

    </style>
</head>

<body>
<div>
    <div id="testdemo" style="margin: 80px 80px;padding: 30px;border: 2px solid #009688;">

    </div>
</div>

<div class="getFormData" style="display: none;">
    <textarea class="site-demo-text" id="get-form-data"></textarea>
</div>
<script th:src="@{/pear/component/layui/layui.js}"></script>
<script th:src="@{/pear/component/luminar/luminar.js}"></script>
<script th:src="@{/pear/component/luminar/js/Sortable/Sortable.js}"></script>
<script th:src="@{/pear/component/luminar/js/iceEditor/iceEditor.js}"></script>

<script th:inline="javascript">
    let baseURL = /*[[@{/}]]*/ '';
    let demojs = [];
    //JavaScript代码区域
    layui.use(['formDesigner', 'form', 'layer', 'upload'], function () {
        let layer = layui.layer;
        let $ = layui.jquery;
        let upload = layui.upload;
        let index = layui.index;
        let formDesigner = layui.formDesigner;
        let form = layui.form;
        let render;
        if (window.localStorage.getItem('layui_form_json') !== undefined) {
            demojs = JSON.parse(window.localStorage.getItem('layui_form_json'));
            render = formDesigner.render({
                elem: '#testdemo',
                data: demojs,
                viewOrDesign: true,
                // formData: {"textarea_1": "123", "input_2": "123", "password_3": "123"}
            });
        }
    });

</script>
</body>

</html>
